package org.gap.service;

import java.util.List;
import java.util.Set;

import org.gap.domain.EtablissementsBancaires;
import org.gap.domain.Guichets;
import org.gap.domain.Pays;

import org.junit.Test;

import org.junit.runner.RunWith;

import org.springframework.beans.factory.annotation.Autowired;

import org.springframework.beans.factory.support.DefaultListableBeanFactory;

import org.springframework.context.ApplicationContext;

import org.springframework.mock.web.MockHttpServletRequest;

import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.TestExecutionListeners;

import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import org.springframework.test.context.support.DependencyInjectionTestExecutionListener;
import org.springframework.test.context.support.DirtiesContextTestExecutionListener;

import org.springframework.test.context.transaction.TransactionalTestExecutionListener;

import org.springframework.transaction.annotation.Transactional;

import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.RequestScope;
import org.springframework.web.context.request.ServletRequestAttributes;
import org.springframework.web.context.request.SessionScope;

/**
 * Class to run the service as a JUnit test. Each operation in the service is a separate test.
 *
 */

@RunWith(SpringJUnit4ClassRunner.class)
@TestExecutionListeners({
		DependencyInjectionTestExecutionListener.class,
		DirtiesContextTestExecutionListener.class,
		TransactionalTestExecutionListener.class })
@ContextConfiguration(locations = {
		"file:./resources/GAP_v2-security-context.xml",
		"file:./resources/GAP_v2-service-context.xml",
		"file:./resources/GAP_v2-dao-context.xml",
		"file:./resources/GAP_v2-web-context.xml" })
@Transactional
public class EtablissementsBancairesServiceTest {

	/**
	 * The Spring application context.
	 *
	 */
	@SuppressWarnings("unused")
	private ApplicationContext context;

	/**
	 * The service being tested, injected by Spring.
	 *
	 */
	@Autowired
	protected EtablissementsBancairesService service;

	/**
	 * Instantiates a new EtablissementsBancairesServiceTest.
	 *
	 */
	public EtablissementsBancairesServiceTest() {
		setupRequestContext();
	}

	/**
	 * Operation Unit Test
	 * Save an existing Guichets entity
	 * 
	 */
	@Test
	public void saveEtablissementsBancairesGuichetses() {
		// TODO: JUnit - Populate test inputs for operation: saveEtablissementsBancairesGuichetses 
		String etbPays = null;
		Integer etbEtablissement = 0;
		Guichets related_guichetses = new org.gap.domain.Guichets();
		EtablissementsBancaires response = null;
		response = service.saveEtablissementsBancairesGuichetses(etbPays, etbEtablissement, related_guichetses);
		// TODO: JUnit - Add assertions to test outputs of operation: saveEtablissementsBancairesGuichetses
	}

	/**
	 * Operation Unit Test
	 * Save an existing EtablissementsBancaires entity
	 * 
	 */
	@Test
	public void saveEtablissementsBancaires() {
		// TODO: JUnit - Populate test inputs for operation: saveEtablissementsBancaires 
		EtablissementsBancaires etablissementsbancaires = new org.gap.domain.EtablissementsBancaires();
		service.saveEtablissementsBancaires(etablissementsbancaires);
	}

	/**
	 * Operation Unit Test
	 * Delete an existing Pays entity
	 * 
	 */
	@Test
	public void deleteEtablissementsBancairesPays() {
		// TODO: JUnit - Populate test inputs for operation: deleteEtablissementsBancairesPays 
		String etablissementsbancaires_etbPays = null;
		Integer etablissementsbancaires_etbEtablissement = 0;
		String related_pays_pppPays = null;
		EtablissementsBancaires response = null;
		response = service.deleteEtablissementsBancairesPays(etablissementsbancaires_etbPays, etablissementsbancaires_etbEtablissement, related_pays_pppPays);
		// TODO: JUnit - Add assertions to test outputs of operation: deleteEtablissementsBancairesPays
	}

	/**
	 * Operation Unit Test
	 * Delete an existing Guichets entity
	 * 
	 */
	@Test
	public void deleteEtablissementsBancairesGuichetses() {
		// TODO: JUnit - Populate test inputs for operation: deleteEtablissementsBancairesGuichetses 
		String etablissementsbancaires_etbPays_1 = null;
		Integer etablissementsbancaires_etbEtablissement_1 = 0;
		Integer related_guichetses_guiEtablissement = 0;
		Integer related_guichetses_guiGuichet = 0;
		String related_guichetses_guiPays = null;
		EtablissementsBancaires response = null;
		response = service.deleteEtablissementsBancairesGuichetses(etablissementsbancaires_etbPays_1, etablissementsbancaires_etbEtablissement_1, related_guichetses_guiEtablissement, related_guichetses_guiGuichet, related_guichetses_guiPays);
		// TODO: JUnit - Add assertions to test outputs of operation: deleteEtablissementsBancairesGuichetses
	}

	/**
	 * Operation Unit Test
	 * Load an existing EtablissementsBancaires entity
	 * 
	 */
	@Test
	public void loadEtablissementsBancairess() {
		Set<EtablissementsBancaires> response = null;
		response = service.loadEtablissementsBancairess();
		// TODO: JUnit - Add assertions to test outputs of operation: loadEtablissementsBancairess
	}

	/**
	 * Operation Unit Test
	 */
	@Test
	public void findEtablissementsBancairesByPrimaryKey() {
		// TODO: JUnit - Populate test inputs for operation: findEtablissementsBancairesByPrimaryKey 
		String etbPays_1 = null;
		Integer etbEtablissement_1 = 0;
		EtablissementsBancaires response = null;
		response = service.findEtablissementsBancairesByPrimaryKey(etbPays_1, etbEtablissement_1);
		// TODO: JUnit - Add assertions to test outputs of operation: findEtablissementsBancairesByPrimaryKey
	}

	/**
	 * Operation Unit Test
	 * Return a count of all EtablissementsBancaires entity
	 * 
	 */
	@Test
	public void countEtablissementsBancairess() {
		Integer response = null;
		response = service.countEtablissementsBancairess();
		// TODO: JUnit - Add assertions to test outputs of operation: countEtablissementsBancairess
	}

	/**
	 * Operation Unit Test
	 * Delete an existing EtablissementsBancaires entity
	 * 
	 */
	@Test
	public void deleteEtablissementsBancaires() {
		// TODO: JUnit - Populate test inputs for operation: deleteEtablissementsBancaires 
		EtablissementsBancaires etablissementsbancaires_1 = new org.gap.domain.EtablissementsBancaires();
		service.deleteEtablissementsBancaires(etablissementsbancaires_1);
	}

	/**
	 * Operation Unit Test
	 * Return all EtablissementsBancaires entity
	 * 
	 */
	@Test
	public void findAllEtablissementsBancairess() {
		// TODO: JUnit - Populate test inputs for operation: findAllEtablissementsBancairess 
		Integer startResult = 0;
		Integer maxRows = 0;
		List<EtablissementsBancaires> response = null;
		response = service.findAllEtablissementsBancairess(startResult, maxRows);
		// TODO: JUnit - Add assertions to test outputs of operation: findAllEtablissementsBancairess
	}

	/**
	 * Operation Unit Test
	 * Save an existing Pays entity
	 * 
	 */
	@Test
	public void saveEtablissementsBancairesPays() {
		// TODO: JUnit - Populate test inputs for operation: saveEtablissementsBancairesPays 
		String etbPays_2 = null;
		Integer etbEtablissement_2 = 0;
		Pays related_pays = new org.gap.domain.Pays();
		EtablissementsBancaires response = null;
		response = service.saveEtablissementsBancairesPays(etbPays_2, etbEtablissement_2, related_pays);
		// TODO: JUnit - Add assertions to test outputs of operation: saveEtablissementsBancairesPays
	}

	/**
	 * Autowired to set the Spring application context.
	 *
	 */
	@Autowired
	public void setContext(ApplicationContext context) {
		this.context = context;
		((DefaultListableBeanFactory) context.getAutowireCapableBeanFactory()).registerScope("session", new SessionScope());
		((DefaultListableBeanFactory) context.getAutowireCapableBeanFactory()).registerScope("request", new RequestScope());
	}

	/**
	 * Sets Up the Request context
	 *
	 */
	private void setupRequestContext() {
		MockHttpServletRequest request = new MockHttpServletRequest();
		ServletRequestAttributes attributes = new ServletRequestAttributes(request);
		RequestContextHolder.setRequestAttributes(attributes);
	}
}
